package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsConstantConfig;
import com.econ.powercloud.ems.dal.mapper.EmsConstantConfigMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2022/11/10 16:39
 * @Modified by : zjf
 */
@Repository
public class EmsConstantConfigDAO extends ServiceImpl<EmsConstantConfigMapper, EmsConstantConfig> {

    public Integer deleteByModule(Integer module){
        LambdaQueryWrapper<EmsConstantConfig> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(EmsConstantConfig::getModule,module);
        return this.baseMapper.delete(wrapper);
    }

    public List<EmsConstantConfig> selectByModule(Integer module){
        LambdaQueryWrapper<EmsConstantConfig> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(EmsConstantConfig::getModule,module);
        return this.baseMapper.selectList(wrapper);
    }
}
